package org.fuys.coder.domain.category.service.impl;

import org.fuys.coder.domain.category.model.vo.CategoryVO;
import org.fuys.coder.domain.category.respository.ICategoryRepository;
import org.fuys.coder.domain.category.service.ICategoryService;
import org.fuys.coder.common.entity.PageDTO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @projectName: fuys-low-coder
 * @package: org.fuys.coder.domain.category.service.impl
 * @className: CategoryService
 * @author: WangJing
 * @description: 服务实现类
 * @date: 2024/6/25 17:04
 * @version: 1.0
 */
@Service
public class CategoryService implements ICategoryService {
    @Resource
    private ICategoryRepository categoryRepository;


    public List<CategoryVO> getAllCategory() {
        return categoryRepository.getAllCategory();
    }

    @Override
    public List<Integer> getAllCategoryId() {
        return categoryRepository.getAllCategoryId();
    }

    @Override
    public List<CategoryVO> getCategoryByName(PageDTO pageDTO, String keywords) {
        return categoryRepository.getCategoryPage(pageDTO.getCurPage(),pageDTO.getPageNum(),keywords);
    }
}
